Quarto One
Quarto One
My first real quarto document to check out the system.
Basic setup with more advanced YAML.
Quarto references:
BC Beer Data
Data obtained from BC Liquor Market Review, a quarterly report from BC Liquor Distribution Branch.
Beer is good! Beer is for everybody!
What’s in the data?
Categories:
| category |
|---|
| Domestic - BC Beer |
| Domestic - Other Province Beer |
| Import Beer |
| category | subcategory |
|---|---|
| Domestic - BC Beer | Domestic - BC Commercial Beer |
| Domestic - BC Beer | Domestic - BC Micro Brew Beer |
| Domestic - BC Beer | Domestic - BC Regional Beer |
| Domestic - Other Province Beer | Domestic - Other Province Commercial Beer |
| Domestic - Other Province Beer | Domestic - Other Province Micro Brew Beer |
| Domestic - Other Province Beer | Domestic - Other Province Regional Beer |
| Import Beer | Asia And South Pacific Beer |
| Import Beer | Europe Beer |
| Import Beer | Mexico And Caribbean Beer |
| Import Beer | Other Country Beer |
| Import Beer | USA Beer |
Date range: 2021-06-30 to 2022-06-30
Stats
Overall View
Totals by Quarter
% Change - Qtr over Qtr
Compare by Same Quarter, Year over Year
More data needed
By Category
Breakdown by Category
Contribution to Change
couple of way to show this:
absolute value of change by category
% of total change that each category makes up (sort of closer to coefficient of determination)
% Change - Qtr over Qtr
Correlation
One-way Anova
Tells us whether there is a difference in the average netsales based on categories or not.
fit <- aov(netsales ~ category, data=beer_data_cat)
summary(fit) Df Sum Sq Mean Sq F value Pr(>F)
category 2 9.630e+16 4.815e+16 244.6 1.88e-10 ***
Residuals 12 2.362e+15 1.969e+14
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Summary tells us that there is a significant difference in mean values of net sales from one category to another.
Variable Significance
Using TukeyHSD
TukeyHSD(fit) Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = netsales ~ category, data = beer_data_cat)
$category
diff lwr upr
Domestic - Other Province Beer-Import Beer 14256668 -9416853 37930188
Domestic - BC Beer-Import Beer 176649011 152975491 200322531
Domestic - BC Beer-Domestic - Other Province Beer 162392343 138718823 186065864
p adj
Domestic - Other Province Beer-Import Beer 0.2804561
Domestic - BC Beer-Import Beer 0.0000000
Domestic - BC Beer-Domestic - Other Province Beer 0.0000000
The output shows the pairwise combinations. If I understand correctly:
NO significant difference between net sales for ‘Domestic - Other Province’ and ‘Import’.
STRONG significant differences between ‘Domestic - BC Beer’ and ‘Import’ AND between ‘Domestic - BC Beer’ and ‘Domestic - Other Province.’
The conclusion is that ‘Domestic - BC Beer’ has the strongest influence on sales. Which of course is clear from looking at the charts.
Linear Regression
Spread the categories into columns
Convert qtr into a dummy variable - spread into cols